package com.peng.mapper;

import com.peng.pojo.User;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

public class UserMapperImp implements UserMapper {
    //我们所有操作都使用sqlSession来执行，sqlsession就是sqlsessionTemple
    private SqlSessionTemplate sqlSesssion;

    public void setSqlSesssion(SqlSessionTemplate sqlSesssion) {
        this.sqlSesssion = sqlSesssion;
    }


    public List<User> selectUser() {
        UserMapper mapper = sqlSesssion.getMapper(UserMapper.class);
        return mapper.selectUser();
    }
}
